home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / FAQSYS18.ZIP / FAQS.DAT / OKT-FORM.TXT / text0000.txt < prev   
Encoding:
Text File  |  1996-01-04  |  11.9 KB  |  243 lines

  1.  
  2. Thanks to all of those mentioned below for the additional infos
  3. and sources. It looks pretty complete now.
  4.  
  5. The effects seem to be complete. All, VT, Multiplayer and the
  6. Amiga Oktalyzer 1.1 Player use the same values. But I didn't see
  7. the effect 12 anywhere (Arp 5), as mentioned by Peter Kunath.
  8.  
  9. -----------------------------------------------------------------
  10.  
  11. [C.3.3]     Oktalyzer
  12.             ---------
  13.  
  14. Thanks to Frank Seide (seide@pfa.philips.de) for the first hints,
  15. Bryan Ford (baford@schirf.cs.utah.edu) for most of the detailed comments
  16. below, the effects, and the (GPL) free source code of his Multiplayer,
  17. the Vangelis Team, which is Juan Carlos Arevalo (jarevalo@moises.ls.fi.upm.es),
  18. Felix Sanz, and Luis Crespo for the Freeware sources of the Vangelis Tracker,
  19. Armin Sander for the (?)first Oktalyzer Player on an Amiga,
  20. Peter Kunath (kunath@informatik.tu-muenchen.de) for several hints,
  21. and Jamal Hannah (jamal@gnu.ai.mit.edu) for coordinating us all.
  22.  
  23. There are two different "Oktalyzer" formats. The following description
  24. only refers to the IFF-like style. The other one (a memory dump model)
  25. seems to have no popularity.
  26.  
  27. (All numbers below are given in hex unless specified as 't'ecimal.)
  28.  
  29. MSB first
  30.  
  31. offset |bytes| contents   | meaning
  32. -------+-----+------------+-------------------------------------------------
  33. 000000 |   8 | "OKTASONG" | char Magic[8]
  34.        |     |            |   /* If you support different music file types
  35.        |     |            |      check these letters. */
  36. -------+-----+------------+-------------------------------------------------
  37.        |     |            | Channel_Modes {
  38. 000008 |   4 | "CMOD"     |   char chunk_name[4]
  39. 00000C |   4 | 8          |   long chunk_len
  40. 000010 |   8 |            |   short chan_flags[4]
  41.        |     |            |   /* 0: normal (Amiga) sound channel         */
  42.        |     |            |   /* 1: 'tied' or 'splitted' channel: two
  43.        |     |            |         sounds are played through this channel
  44.        |     |            |         at the same time (mixed at run time) */
  45.        |     |            |   /* eg. 0 1 0 1 => 6 channel: 1: normal,
  46.        |     |            |      2/3: tied, 4: normal, 5/6: tied         */
  47.        |     |            | }
  48. -------+-----+------------+-------------------------------------------------
  49.        |     |            | Sample_directory {
  50. 000018 |   4 | "SAMP"     |   char chunk_name[4]
  51. 00001C |   4 | (00000480) |   long Sample_dir_len /*==chunk_len*/
  52.        |     |            |        /* Nr_of_samples = Sample_dir_len / 32 */
  53.        |     |            |
  54. 000020 |  20t|            |   char Sample_Name[20]             \
  55. 000034 |   4 |            |     unsigned long  Sample_Len       )
  56. 000038 |   2 |            |     unsigned short Repeat_Start    (   up to 36x
  57. 00003A |   2 |            |     unsigned short Repeat_Len       > (or more?)
  58. 00003C |   1 | (00)       |     char           pad1            (
  59. 00003D |   1 | (40)       |     unsigned char  Volume           )
  60. 00003E |   2 | (0001)     |     short          pad2            /
  61. ...    |     |            | /*
  62.        |     |            | If 'Repeat_Len' is zero, it is a simple one-shot
  63.        |     |            | sample: ignore 'Repeat_Start', just play the whole
  64.        |     |            | 'Sample_Len' bytes and stop the sound.
  65.        |     |            | If 'Repeat_Len' is nonzero, it is a repeating sample
  66.        |     |            | consisting of three parts: attack, sustain, and re-
  67.        |     |            | lease. (Most other tracker formats don't support re-
  68.        |     |            | lease.) The attack part starts at 0 and ends at
  69.        |     |            | Repeat_Start-1, the sustain part starts at 'Repeat_
  70.        |     |            | Start' and ends at Repeat_Start+Repeat_Len-1, and
  71.        |     |            | the release part starts at Repeat_Start+Repeat_Len
  72.        |     |            | and ends at Sample_Length-1.
  73.        |     |            | The attack part should be played once, followed by
  74.        |     |            | the repeat part an arbitrary number of times until
  75.        |     |            | another note is played or a "release" command is
  76.        |     |            | seen. If the "release" command is seen, then switch
  77.        |     |            | to the release part of the sample when the current
  78.        |     |            | repeat run is finished, and only play it once, fol-
  79.        |     |            | lowed by silence.
  80.        |     |            | 'Volume' is the default volume for notes played with
  81.        |     |            | this sample: 0 to 64 (0x40) inclusive. */
  82.        |     |            | }
  83. -------+-----+------------+-------------------------------------------------
  84.        |     |            | Speed {
  85. 0004A0 |   4 | "SPEE"     |   char  chunk_name[4]
  86. 0004A4 |   4 | 2          |   long  chunk_len
  87. 0004A8 |   2 | (3)        |   short AmigaVBLDivisor /* InitialTempo */
  88.        |     |            | }
  89. -------+-----+------------+-------------------------------------------------
  90.        |     |            | Song_Length {
  91. 0004AA |   4 | "SLEN"     |   char  chunk_name[4]
  92. 0004B2 |   4 | 2          |   long  chunk_len
  93. 0004B6 |   2 | (60t)      |   short value
  94.        |     |            |         /* it specifies the number of different
  95.        |     |            |            patterns this module has.
  96.        |     |            |            (can be used as counter for the "PBOD"
  97.        |     |            |            chunks) */
  98.        |     |            | }
  99. -------+-----+------------+-------------------------------------------------
  100.        |     |            | Num_Pattern_Positions { /* "PatternLength" */
  101. 0004B8 |   4 | "PLEN"     |   char  chunk_name[4]
  102. 0004BC |   4 | 2          |   long  chunk_len
  103. 0004BE |   2 | (15t)      |   short num_positions
  104.        |     |            |         /* it specifies the number of entries in
  105.        |     |            |            the pattern table (see "PATT" below) */
  106.        |     |            | }
  107. -------+-----+------------+- - - - - - - - - - - - - - - - - - - - - - - - -
  108.        |     |            | Pattern_Positions {
  109. 0004C0 |   4 | "PATT"     |   char  chunk_name[4]
  110. 0004C4 |   4 | (128t ?)   |   long  chunk_len
  111.        |     |            |         /* (it seems that the length of this chunk
  112.        |     |            |             is always set to 128) */
  113. 0004C8 | 128t|            |   byte  position[*]
  114.        |     |            |         /* zero *is* a valid value in this field.
  115.        |     |            |            it means that pattern number 0 should
  116.        |     |            |            be played. the number of valid positions
  117.        |     |            |            is specified by the "PLEN" chunk. */
  118.        |     |            | }
  119. =======+=====+============+=================================================
  120.        |     |            | Pattern1 {
  121. 000548 |   4 | "PBOD"     |   char  chunk_name[4]            )
  122. 00054C |   4 | (0702      |   long  chunk_len               (  up to 64
  123.        |     |  or 0602)  |                                  > patterns are
  124. 00054E |   2 | (64t)      |   short num_pattern_lines       (  supported
  125. 000550 |  ...|            |   byte  Pattern1_Line[*]         )
  126.        |     |            |         /* see below */
  127.        |     |            | }
  128. ...    |     |            |
  129. =======+=====+============+=================================================
  130.        |     |            | Sample1 {
  131. 0..... |   4 | "SBOD"     |   char  chunk_name[4]            ) up to 255* is
  132. 0..... |   4 |            |   long  chunk_len               (_ possible but
  133. 0..... |  ...|            |   byte  sample_data[*]          (  mostly limited
  134. ...    |     |            |         /* 8 bit signed data */  ) to 36*
  135.        |     |            | }
  136. ...    |     |            |
  137. =======+=====+============+=================================================
  138. Values in parentheses are examples and may vary.
  139. (If you choose the faster methode to check the chunk types using a 'long'-
  140. value, don't forget to exchange the byte order on LSB-systems.)
  141.  
  142. There are 36 effects, instruments and notes. In the original Oktalyzer
  143. editor they are entered using the 10 digits and the 26 letters, that's
  144. why 36.
  145. ____
  146.  
  147. A pattern line (PBOD chunks) looks like follows:
  148.  
  149. After the 16-bit num_pattern_lines are that many lines of pattern data,
  150. each line containing four bytes for each active channel.
  151. For example, in a 6-channel module, each line is 24 bytes.
  152.  
  153. The four bytes of one channel are:
  154.  
  155.     unsigned char newnote,
  156.     unsigned char instrument, /* sample */
  157.     unsigned char effect,
  158.     unsigned char data        /* effect parameter */
  159.  
  160. If newnote is nonzero, start playing a different note. There are 36 pitches,
  161. 1-36 (see pertab below).
  162.  
  163. Set the current channel's volume to the sample's volume.
  164. 'instrument' indicates which sample to use.
  165.  
  166. Whether or not newnote is nonzero, process 'effect' and 'data' (see effects
  167. below).
  168. ___
  169.  
  170. Oktalyzer uses the following period table, which is the same as for ST/NT/PT-
  171. Mod-Files. (converted to C actually, but the same numbers)
  172.  
  173. static short pertab[] =
  174. {
  175. /*  C    C#     D    D#      E     F    F#     G    G#      A    A#     B */
  176.  0x358,0x328,0x2FA,0x2D0, 0x2A6,0x280,0x25C,0x23A, 0x21A,0x1FC,0x1E0,0x1C5,
  177.  0x1AC,0x194,0x17D,0x168, 0x153,0x140,0x12E,0x11D, 0x10D, 0xFE, 0xF0, 0xE2,
  178.   0xD6, 0xCA, 0xBE, 0xB4,  0xAA, 0xA0, 0x97, 0x8F,  0x87, 0x7F, 0x78, 0x71
  179. };
  180.  
  181. The extended octaves 0 and 4 which might be found in other formats are not
  182. used here.
  183. ____
  184.  
  185. The Oktalyzer format defines the following effects (decimal):
  186.  
  187.  1  Portamento down: decrease period of current sample by 'data',
  188.                      once every 50Hz clock tick.
  189.  2  Portamento up:   increase period of current sample by 'data',
  190.                      once every 50Hz clock tick.
  191.  
  192. 10  Arpeggio 3: Change note every 50Hz tick between L,N,H
  193. 11  Arpeggio 4: Change note every 50Hz tick between N,H,N,L
  194. 12  Arpeggio 5: Change note every 50Hz tick between H,H,N
  195.                 N = normal note being played in this channel (1-36)
  196.                 L = normal note number minus upper four bits of 'data'.
  197.                 H = normal note number plus  lower four bits of 'data'.
  198.  
  199. 13  Decrease note number by 'data' once per tick.
  200. 17  Increase note number by 'data' once per tick.
  201. 21  Decrease note number by 'data' once per line.
  202. 30  Increase note number by 'data' once per line.
  203.  
  204. 15  Amiga low-pass filter control: 'data' indicates the new setting.
  205.  
  206. 25  Position jump: Instead of going to the next line after this one,
  207.           instead jump to the beginning of pattern number 'data'.
  208.  
  209. 27  Release: start playing the release phase of the currently playing
  210.              sample.
  211.  
  212. 28  Set speed (number of 50Hz ticks between advancing lines) to 'data'.
  213.  
  214. 31  Volume control:
  215.       If 'data' <= 0x40, set the volume of this channel to 'data'.
  216.       If 0x41 <= 'data' <= 0x50, decrease volume by 'data' - 0x40
  217.                                  every 50Hz clock tick (fast fade out).
  218.       If 0x51 <= 'data' <= 0x60, increase volume by 'data' - 0x50
  219.                                  every 50Hz clock tick (fast fade in).
  220.       If 0x61 <= 'data' <= 0x70, decrease volume by 'data' - 0x60
  221.                                  at the beginning of every line (slow fade out).
  222.       If 0x71 <= 'data' <= 0x80, increase volume by 'data' - 0x70
  223.                                  at the beginning of every line (slow fade in).
  224.  
  225. --
  226. There seems to be much room for future extentions, eg. panning.
  227.  
  228. ... now it's complete? (HZ)
  229.  
  230. -----------------------------------------------------------------
  231.  
  232. Harald
  233.  
  234. --
  235. >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<
  236.  zappe@gaea.sietec.de              |  |
  237.                                    |--+-              everything is relative
  238.  Harald Zappe                      |  |/              nothing is for infinity
  239.  work: +49-30-386-28328/29            /               quantity is not quality
  240.  home: +49-30-ASK-ME                 /___              
  241.  
  242.  
  243.